<?php
/**
 * @package skywriter
 */
if ($modx->event->name == 'OnRichTextEditorRegister') {
    $modx->event->output('Skywriter');
    return;
}


$assetsUrl = $modx->getOption('skywriter.assets_url', $scriptProperties, $modx->getOption('assets_url').'components/skywriter/');


$options = array(
	'event' => $modx->event->name
);


$modx->regClientStartupHTMLBlock('<link id="bespin_base" href="' . $assetsUrl . 'vendor/" />');
$modx->regClientStartupHTMLBlock('<script type="text/javascript">MODx.skywriter = '.$modx->toJSON($options).';</script>');
$modx->regClientStartupScript($assetsUrl.'vendor/BespinEmbedded.js');
$modx->regClientStartupScript($assetsUrl.'vendor/php_syntax.js');
$modx->regClientStartupScript($assetsUrl.'js/skywriter.js');


return;